package com.fdmgroup.benchmarker.lib.common.utilities;

import com.fdmgroup.benchmarker.lib.common.BenchmarkReport;
import com.fdmgroup.benchmarker.lib.common.BenchmarkResult;
import com.fdmgroup.benchmarker.lib.common.BenchmarkSettings;

public class BenchmarkReportUtility {
	public static BenchmarkReport createBenchmarkReport(
			BenchmarkSettings settings, BenchmarkResult result) {
		long performance = (long)(1000d/(double)result.getDuration() * result.getTasks());
		return new BenchmarkReport(performance, settings.getPoolSize(),
				settings.getSampleSize(), result.getTasks(),
				result.getDuration());
	}
}
